package com.efounder.mobilecomps.contacts;

import java.io.Serializable;
import java.util.Map;
import java.util.Objects;


public class User implements Serializable, Cloneable {
    /**
     *
     */
    private static final long serialVersionUID = 1L;

    /**
     * 好友请求未接受
     */
    public static final int UNACCEPT = 0;
    /**
     * 好友请求已添加已接受
     */
    public static final int ACCEPTED = 1;
    /**
     * 好友请求已发送
     */
    public static final int SENT = 2;
    /**
     * 好友请求已拒绝
     */
    public static final int REFUSE = 3;
    /**
     * 好友请求被拒绝
     */
    public static final int REJECTED = 4;

    /**
     * 个人好友
     */
    public static final int PERSONALFRIEND = 0;
    /**
     * 公众号好友
     */
    public static final int PUBLICFRIEND = 1;


    /**
     * 群组普通成员
     */
    public static final int GROUPMEMBER = 0;
    /**
     * 群组管理员
     */
    public static final int GROUPMANAGER = 1;
    /**
     * 群组创建者
     */
    public static final int GROUPCREATOR = 9;


    /**
     * 用户id
     **/
    private int id;
    /**
     * 登录的用户id
     **/
    private int loginUserId;
    /**
     * 用户名
     **/
    private String name;
    /**
     * 用户昵称
     **/
    private String nickName;

    /**
     * 用户昵称拼音首字母简写（例如 松1 =>s1）
     **/
    private String nickNamePyInitial;
    /**
     * 用户昵称拼音全拼
     **/
    private String nickNameQuanPin;
    /**
     * 性别
     **/
    private String sex;
    /**
     * 电话
     **/
    private String phone;
    /**
     * 移动电话
     **/
    private String mobilePhone;
    /**
     * 头像文件名
     **/
    private String avatar;
    /**
     * 邮箱
     **/
    private String email;
    /**
     * 备注
     **/
    private String reMark;

    /**
     * 用户备注首字母简写（例如 松1 =>s1）
     **/
    private String remarkPyInitial;
    /**
     * 用户备注音全拼
     **/
    private String remarkQuanPin;
    /**
     * 个性签名
     **/
    private String sigNature;
    /**
     * 部门id
     **/
    private int deptId;
    /**
     * 是否星标好友
     **/
    private Boolean isImportantContacts = false;
    /**
     * 是否接受消息
     **/
    private Boolean isBother = false;
    /**
     * 是否置顶
     **/
    private Boolean isTop = false;
    /**
     * 显示数据拼音的首字母
     **/
    private String sortLetters;
    /**
     * 好友类型，比如公众号 特殊的好友
     **/
    private int type;
    /**
     * 好友请求状态
     **/
    private int state;
    /**
     * 好友请求时间
     **/
    private long time;
    /**
     * 请求是否已读
     **/
    private boolean isRead;
    /**
     * 自己设置的群组备注（比如海鹏给海鹏自己设置备注）
     **/
    private String ownGroupRemark;
    /**
     * 别人设置的群组备注（我给别人设置）
     **/
    private String otherGroupRemark;

    /**
     * 群组成员的属性 0普通用户 1管理员 9 创建者
     */
    private int groupUserType;
    /**
     * user角标
     */
    private int badgenum;
    /**
     * 是否是好友
     **/
    //private Boolean isFriend = true;

    // 用户动态生成的备注栏
    private Map<String, String> remarkmap;

    //关注应用号是否需要管理员审批，如果公众号publicType为0，则用户自动关注成功；1，需要审批
    private int publicType;
    //用户是否存在
    private boolean isExist = true;

    //钱包地址
    private String walletAddress;
    //公钥
    private String publicKey;

    //微信付款码 图片
    private String weixinQrUrl;
    //支付宝付款码 图片
    private String zhifubaoQrUrl;
    //RSA公钥
    private String RSAPublicKey;
    //是否允许陌生人与我聊天
    private boolean allowStrangerChat = true;
    //群聊中，该用户是否被禁言
    private boolean groupBanSpeak;
    //添加好友时留下的验证信息
    private String leaveMessage;
    //星际通讯中用户的星球
    private String planet;

    /**
     *     财务共享显示
     */
    //公司
    private String company;
    //部门名称
    private String bmmc;

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getBmmc() {
        return bmmc;
    }

    public void setBmmc(String bmmc) {
        this.bmmc = bmmc;
    }

    public User() {
        super();
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getMobilePhone() {
        return mobilePhone;
    }

    public void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public int getDeptId() {
        return deptId;
    }

    public void setDeptId(int deptId) {
        this.deptId = deptId;
    }

    public String getSortLetters() {
        return sortLetters;
    }

    public void setSortLetters(String sortLetters) {
        this.sortLetters = sortLetters;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getReMark() {
        return reMark;
    }

    public void setReMark(String reMark) {
        this.reMark = reMark;
    }

    public Boolean getIsImportantContacts() {
        return isImportantContacts;
    }

    public void setIsImportantContacts(Boolean isImportantContacts) {
        this.isImportantContacts = isImportantContacts;
    }

    public Boolean getIsBother() {
        return isBother;
    }

    public void setIsBother(Boolean isBother) {
        this.isBother = isBother;
    }

    public Boolean getIsTop() {
        return isTop;
    }

    public void setIsTop(Boolean isTop) {
        this.isTop = isTop;
    }

    public Map<String, String> getRemarkmap() {
        return remarkmap;
    }

    public String getPlanet() {
        return planet;
    }

    public User setPlanet(String planet) {
        this.planet = planet;
        return this;
    }
//	public Boolean getIsFriend() {
//		return isFriend;
//	}
//

    public boolean getIsRead() {
        return isRead;
    }

    public void setIsRead(boolean read) {
        isRead = read;
    }
//	public void setIsFriend(Boolean isFriend) {
//		this.isFriend = isFriend;
//	}

    public String getSigNature() {
        return sigNature;
    }

    public void setSigNature(String sigNature) {
        this.sigNature = sigNature;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getLoginUserId() {
        return loginUserId;
    }

    public void setLoginUserId(int loginUserId) {
        this.loginUserId = loginUserId;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public void setRemarkmap(Map<String, String> remarkmap) {
        this.remarkmap = remarkmap;
    }

    public String getOtherGroupRemark() {
        return otherGroupRemark;
    }

    public void setOtherGroupRemark(String otherGroupRemark) {
        this.otherGroupRemark = otherGroupRemark;
    }

    public String getOwnGroupRemark() {
        return ownGroupRemark;
    }

    public void setOwnGroupRemark(String ownGroupRemark) {
        this.ownGroupRemark = ownGroupRemark;
    }

    public int getGroupUserType() {
        return groupUserType;
    }

    public void setGroupUserType(int groupUserType) {
        this.groupUserType = groupUserType;
    }

    public int getBadgenum() {
        return badgenum;
    }

    public void setBadgenum(int badgenum) {
        this.badgenum = badgenum;
    }

    public int getPublicType() {
        return publicType;
    }

    public void setPublicType(int publicType) {
        this.publicType = publicType;
    }

    public boolean isExist() {
        return isExist;
    }

    public User setExist(boolean exist) {
        isExist = exist;
        return this;
    }

    public String getWalletAddress() {
        return walletAddress;
    }

    public User setWalletAddress(String walletAddress) {
        this.walletAddress = walletAddress;
        return this;
    }

    public String getPublicKey() {
        return publicKey;
    }

    public User setPublicKey(String publicKey) {
        this.publicKey = publicKey;
        return this;
    }

    public String getRSAPublicKey() {
        return RSAPublicKey;
    }

    public User setRSAPublicKey(String RSAPublicKey) {
        this.RSAPublicKey = RSAPublicKey;
        return this;
    }


    public String getWeixinQrUrl() {
        return weixinQrUrl;
    }

    public User setWeixinQrUrl(String weixinQrUrl) {
        this.weixinQrUrl = weixinQrUrl;
        return this;
    }

    public String getZhifubaoQrUrl() {
        return zhifubaoQrUrl;
    }

    public User setZhifubaoQrUrl(String zhifubaoQrUrl) {
        this.zhifubaoQrUrl = zhifubaoQrUrl;
        return this;
    }

    public boolean isAllowStrangerChat() {
        return allowStrangerChat;
    }

    public User setAllowStrangerChat(boolean allowStrangerChat) {
        this.allowStrangerChat = allowStrangerChat;
        return this;
    }

    public boolean isGroupBanSpeak() {
        return groupBanSpeak;
    }

    public User setGroupBanSpeak(boolean groupBanSpeak) {
        this.groupBanSpeak = groupBanSpeak;
        return this;
    }

    public String getLeaveMessage() {
        return leaveMessage;
    }

    public User setLeaveMessage(String leaveMessage) {
        this.leaveMessage = leaveMessage;
        return this;
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
        User user = (User) super.clone();
        return user;
    }

    public String getNickNamePyInitial() {
        return nickNamePyInitial;
    }

    public User setNickNamePyInitial(String nickNamePyInitial) {
        this.nickNamePyInitial = nickNamePyInitial;
        return this;
    }

    public String getNickNameQuanPin() {
        return nickNameQuanPin;
    }

    public User setNickNameQuanPin(String nickNameQuanPin) {
        this.nickNameQuanPin = nickNameQuanPin;
        return this;
    }

    public String getRemarkPyInitial() {
        return remarkPyInitial;
    }

    public User setRemarkPyInitial(String remarkPyInitial) {
        this.remarkPyInitial = remarkPyInitial;
        return this;
    }

    public String getRemarkQuanPin() {
        return remarkQuanPin;
    }

    @Override
    public int hashCode() {

        return Objects.hash( id, ownGroupRemark, otherGroupRemark, groupUserType, badgenum, remarkmap, publicType, isExist, walletAddress, publicKey, weixinQrUrl, zhifubaoQrUrl, RSAPublicKey, allowStrangerChat, groupBanSpeak, leaveMessage );
    }

    public User setRemarkQuanPin(String remarkQuanPin) {
        this.remarkQuanPin = remarkQuanPin;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return id == user.id;
    }
}
